// ----------------------------------------------------------------------------
// Copyright 2016-2017 ARM Ltd.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------

#ifndef MBED_CLOUD_CLIENT_CONFIG_H
#define MBED_CLOUD_CLIENT_CONFIG_H

#include <stdint.h>

/*! \file MbedCloudClientConfig.h
* \brief Configuration options (set of defines and values).
*
*  This lists a set of compile-time options that needs to be used to enable
*  or disable features selectively, and set the values for the mandatory
*  parameters.
*/

// Include configurations from mbed-client.
#include "mbed-client/m2mconfig.h"

// Include user defined configuration.
#ifdef MBED_CLOUD_CLIENT_USER_CONFIG_FILE
#include MBED_CLOUD_CLIENT_USER_CONFIG_FILE
#endif

#ifdef MBED_CLIENT_USER_CONFIG_FILE
#include MBED_CLIENT_USER_CONFIG_FILE
#warning MBED_CLIENT_USER_CONFIG_FILE macro is deprecated. \
Please use only MBED_CLOUD_CLIENT_USER_CONFIG_FILE.
#endif

#ifdef __cplusplus
#if defined (__ICCARM__)
#define m2m_deprecated
#else
#define m2m_deprecated __attribute__ ((deprecated))
#endif
#endif

/**
* \def MBED_CLOUD_CLIENT_ENDPOINT_TYPE
*
* \brief This is an optional MACRO. You can define it like this #define MBED_CLOUD_CLIENT_ENDPOINT_TYPE "default".
*/
#ifndef MBED_CLOUD_CLIENT_ENDPOINT_TYPE
#define MBED_CLOUD_CLIENT_ENDPOINT_TYPE             "default"
#endif

// internal client configuration
#define MBED_CLOUD_CLIENT_PROFILE_FULL 1
#define MBED_CLOUD_CLIENT_PROFILE_LITE 2
#define MBED_CLOUD_CLIENT_PROFILE MBED_CLOUD_CLIENT_PROFILE_FULL

/**
* \def MBED_CLOUD_CLIENT_LIFETIME
*
* \brief This is optional MACRO. You can define it like this: #define MBED_CLOUD_CLIENT_LIFETIME 86400.
* This value denotes time in seconds.
*/
#ifndef MBED_CLOUD_CLIENT_LIFETIME
#define MBED_CLOUD_CLIENT_LIFETIME                  86400
#endif

#if __DOXYGEN__
/**
* \def MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP
* \brief Enable this MACRO if you want to enable UDP mode for the client.
*/
#define MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP
/**
* \def MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP
* \brief Enable this MACRO if you want to enable TCP mode for the client. This is the default for client.
*/
#define MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP
/**
* \def MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE
* \brief Enable this MACRO if you want to enable UDP_QUEUE mode for the client.
*/
#define MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE
#endif // __DOXYGEN__

#if !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP) && !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP) && !defined(MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE)
#define MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP
#endif

/**
* \def MBED_CLOUD_CLIENT_LISTEN_PORT
*
* \brief This is mandatory MACRO and is set to 0 by default. This implies that the client picks a random port
 * for listening to the incoming connection.
*/
#ifndef MBED_CLOUD_CLIENT_LISTEN_PORT
#define MBED_CLOUD_CLIENT_LISTEN_PORT               0
#endif

/**
* \def MBED_CLOUD_CLIENT_CUSTOM_URI_PORT
*
* \brief This is optional MACRO and is not set by default. This implies that if application wants the client to connect
* on any other CoAP port then provided through factory or developer provisioned URI port they can override that port number.
*  But, its application's responsibility to ensure that the provided port is open on server side to accept incoming CoAP
*  connection.
*/
//#define MBED_CLOUD_CLIENT_CUSTOM_URI_PORT              5684


#include "MbedCloudClientConfigCheck.h"

#endif // MBED_CLOUD_CLIENT_CONFIG_H
